<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
    <title>Title</title>
    <link rel="stylesheet" href="/webjars/layui/2.5.6/css/layui.css" media="all">
    <script src="/webjars/layui/2.5.6/layui.all.js"></script>

</head>
<body>
<form action="/myUpload" method="post" enctype="multipart/form-data">
    <input type="file" name="file">
    <button>上传</button>
</form>
<form class="layui-form"  method="post" id="myForm"  enctype="multipart/form-data">
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">内容</label>
        <div class="layui-input-block">
            <textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="content"></textarea>
        </div>
    </div>
</form>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
    });
    layui.use(['form', 'layedit', 'laydate'], function() {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
        //上传图片,必须放在 创建一个编辑器前面
        layedit.set({
            uploadImage: {
                url: '/uploadFile' //接口url
                ,type: 'post' //默认post
            }
        });
        //创建一个编辑器
        var editIndex = layedit.build('content',{
                height:400
            }
        );
    });
</script>
</body>
</html>